home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / fft.lha / fft / myenv.h < prev    next >
C/C++ Source or Header  |  1993-08-08  |  1KB  |  49 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2. //************************************************************************
  3. //
  4. //            A standard environment
  5. //              I am accustomed to
  6.  
  7. #pragma once
  8. #pragma interface
  9.  
  10.                 /* Strings of symbols            */
  11.                 /* They may be used as a delimiting lines*/
  12. extern const char _Minuses [];
  13. extern const char _Asteriscs [];
  14. extern const char _Equals [];
  15.  
  16.                 /* Print an error message at stderr and    */
  17.                 /* abort                */
  18. volatile void _error(
  19.     const char * message,        /* Message to be printed    */
  20.     ...                             /* Additional args to printf    */
  21.        );
  22.  
  23.                 /* Print a message at stderr         */
  24. void message(
  25.     const char * text,        /* Message to be printed    */
  26.     ...                             /* Additional args to printf    */
  27.        );
  28.  
  29.  
  30. //------------------------------------------------------------------------
  31. //            Verify the assertion
  32.  
  33. #if 0
  34.                       /* Print a message and abort*/
  35. extern volatile void _error( const char * message,... ); 
  36. #endif
  37.  
  38. #define assert(ex) \
  39.         (void)((ex) ? 1 : \
  40.               (_error("Failed assertion " #ex " at line %d of `%s'.\n", \
  41.                __LINE__, __FILE__), 0))
  42. #define assertval(ex) assert(ex)
  43.  
  44. #define assure(expr,message)                \
  45.     if    (expr) ;                \
  46.     else _error("%s\n at line %d of '%s'.",message,__LINE__, __FILE__);
  47.  
  48.  
  49.